from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import options
from login import Login

url = r'http://192.168.226.131/upload/'
username = 'test01'
pwd = '123456'
driver = webdriver.Chrome(options=options)  # 初始化谷歌浏览器对象
driver.get(url)
driver.maximize_window()

login = Login(driver)
login.login(username, pwd)
sleep(3)

#看帖
driver.find_element(By.XPATH,'//*[@id="category_1"]/table/tbody/tr[1]/td[2]/h2/a').click()
driver.find_element(By.XPATH,'//*[@id="normalthread_14"]/tr/th/a[2]').click()
sleep(3)

login.loginout()
sleep(3)